﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using Negocios;

namespace DigitalTVWS
{
    // NOTE: If you change the class name "Service1" here, you must also update the reference to "Service1" in Web.config and in the associated .svc file.
    public class Programacao : IProgramacao
    {

        /*
        public CompositeType GetDataUsingDataContract(CompositeType composite)
        {
            if (composite.BoolValue)
            {
                composite.StringValue += "Suffix";
            }
            return composite;
        }
        * */
        #region IProgramacao Members

        public String[] getProgramacao(int canal)
        {
            
            Dictionary<int, string> d = new Dictionary<int, string>();
            List<ProgramacaoBO> lista = ProgramacaoBOMetodosWS.getProgramacao(canal);
            int cont = 0;
            String[] str = new String[20];
            foreach(ProgramacaoBO bo in lista){
                String desc = "";
                desc = bo.Episodio.Nome;
                desc += " --- ";
                desc += bo.Data_Hora.ToShortDateString();
                d.Add(bo.Id, desc);
                str[cont] = bo.Id + " - " + desc;
                cont++;
            }
            return str;
        }

        #endregion

        #region IProgramacao Members


        public string getSinopse(int episodio)
        {
            EpisodioBO bo = ProgramacaoBOMetodosWS.getEpisodio(episodio);
            return " Sinopse:" + bo.Sinopse;
        }

        #endregion
    }
}
